const baseUrl = window.location.origin + '/api/'
//const devUrl = 'http://121.36.229.129:8082/api/' // 测试地址
//const devUrl = 'http://192.168.31.215:8800/api/' // 凌本地/
const devUrl = 'http://192.168.31.246:8800/api/' // 本地/
// const devUrl = 'http://localhost:8800/api/'

const url = process.env.NODE_ENV === 'production' ? baseUrl : devUrl
const api = {
  baseUrl: url,
  // tpm
  tpmMachineType: url + 'Tpm/MachineType/',
  tpmMachin: url + 'Tpm/Machine/',
  TpmEquipmentFile: url + 'Tpm/TpmEquipmentFile/',
  TpmAfterSales: url + 'Tpm/TpmAfterSales/',
  TpmEquipmentPart: url + 'Tpm/TpmEquipmentPart/',
  TpmEquipmentPost: url + 'Tpm/TpmEquipmentPost/',
  TpmSpotCheckItem: url + 'Tpm/TpmSpotCheckItem/',
  TpmPartAccount: url + 'Tpm/TpmPartAccount/',
  TpmSpotCheckPlan: url + 'Tpm/TpmSpotCheckPlan/',
  TpmSpotCheckTask: url + 'Tpm/TpmSpotCheckTask/',
  TpmMaintenanceItem: url + 'Tpm/TpmMaintenanceItem/',
  TpmMaintenancePlan: url + 'Tpm/TpmMaintenancePlan/',
  TpmMaintenanceTask: url + 'Tpm/TpmMaintenanceTask/',
  TpmFaultType: url + 'Tpm/TpmFaultType/',
  TpmRepairRequest: url + 'Tpm/TpmRepairRequest/',
  TpmRepairOrder: url + 'Tpm/TpmRepairOrder/',
  TpmPartReceive: url + 'Tpm/TpmPartReceive/',
  TpmPartScrap: url + 'Tpm/TpmPartScrap/',
  //admin
  user: url + 'platform/user/',
  menu: url + 'platform/menu/',
  role: url + 'platform/role/',
  login: url + 'platform/login/',
  qywxLogin: url + 'platform/qywxLogin/',
  userInfo: url + 'platform/getuserbytoken/',
  menuOptions: url + 'platform/getMenuOptions/',
  changePass: url + 'platform/user/updatepassword',
  param: url + 'platform/param/',
  siteInfo: url + 'Platform/systeminfo',
  dictionary: url + 'platform/dictionary/',
  quartz: url + 'platform/quartz/',
  appVersion: url + 'platform/AppVersion/',
  sysLog: url + 'platform/SysLog/',
  organize: url + 'platform/organize/',
  workflow: url + 'platform/workflow/',

  //basic data
  basedata: url + 'basedata/',
  company: url + 'MasterData/company/',
  plant: url + 'MasterData/plant/',
  section: url + 'MasterData/section/',
  line: url + 'MasterData/line/',
  shiftTarget: url + 'MasterData/shifttarget/',
  groupType: url + 'MasterData/grouptype/',
  shift: url + 'MasterData/shift/',
  shiftitem: url + 'MasterData/shiftitem/',
  lineowner: url + 'MasterData/lineowner/',
  warehouse: url + 'MasterData/warehouse/',
  stock: url + 'MasterData/stock/',
  barcodeRule: url + 'MasterData/barcoderule/',
  //barcodeDetail: url + 'MasterData/detail/',
  factor: url + 'MasterData/factor/',
  vendor: url + 'MasterData/vendor/',
  mapackage: url + 'masterdata/mapackage/',
  piecerateManager: url + 'MasterData/piecerate/',
  //master data
  group: url + 'MasterData/group/',
  model: url + 'masterdata/model/',
  material: url + 'masterdata/mat/',
  partmap: url + 'masterdata/partmap/',
  issueReceipt: url + 'masterdata/issuereceipt/',
  sku: url + 'masterdata/sku/',
  custom: url + 'masterdata/cust/',
  machine: url + 'masterdata/machine/',
  machineType: url + 'masterdata/machineType/',
  tooling: url + 'masterdata/tooling/',
  toolingType: url + 'masterdata/toolingType/',
  errorCode: url + 'masterdata/ec/',
  mo: url + 'mes/mo/',
  burn: url + 'mes/burn/',
  bom: url + 'mes/bom/',
  smt: url + 'mes/smt/',
  ppmatch: url + 'mes/ppmatch/',
  bindsn: url + 'mes/bindsn/',
  mat: url + 'masterdata/mat/',
  esop: url + 'mes/esop/',
  package: url + 'masterdata/package/',
  barCode: url + 'masterdata/barCode/',
  fileupload: url + 'Platform/file/',
  matprefix: url + 'mes/matprefix/',
  grouppickup: url + 'mes/grouppickup/',
  uph: url + 'mes/uph/',
  attendance: url + 'mes/attendance/',
  snsplitrule: url + 'masterdata/snsplitrule/',
  materialprint: url + 'Mes/materialprint/',

  station: url + 'masterdata/station/',

  //quality
  changeStation: url + 'mes/quality/changestation/',
  hold: url + 'mes/quality/hold/',
  quahold: url + 'mes/quality/quahold/',
  repair: url + 'mes/quality/repair/',
  carton: url + 'mes/quality/carton/',
  unPack: url + 'mes/quality/unPack/',
  forbid: url + 'mes/quality/mat/forbid/',
  iqc: url + 'Wms/iqc/',
  //iot
  cfg: url + 'iot/airtight/cfg/',
  testlog: url + 'iot/airtight/testlog/getlist',
  iotate: url + 'iot/ate/cfg/',
  iottestlog: url + 'iot/ate/testlog/getlist',
  //report
  moReport: url + 'mes/reports/mo/getlist',
  wipReport: url + 'mes/reports/wiprpt/getlist',
  wipDetailReport: url + 'mes/reports/wiprpt/getdetail',
  wipLogReport: url + 'mes/reports/wiprpt/getlog',
  SumByGroup: url + 'mes/reports/wiprpt/getSumByGroup',
  barcodeReport: url + 'mes/reports/barcode/getlist',
  yieldrateReport: url + 'mes/reports/yieldrate/getlist',
  repairReport: url + 'mes/reports/repair/getlist',
  testReport: url + 'mes/reports/summary/gettestlist',
  wipkpsReport: url + 'mes/reports/wipkps/',
  mokpsReport: url + 'mes/reports/mo/kpslist/',
  maInvReport: url + 'mes/reports/wms/',
  pallet: url + 'mes/reports/pallet/getlist/',
  dailyplan: url + 'mes/reports/dailyplan/summary/',
  piecerate: url + 'mes/reports/piecerate/',
  snCartonMapping: url + 'mes/reports/wiprpt/carton/mapping/',
  //wms report ---不确定要不要了
  wMatFeeding: url + 'reports/wms/machine/feeding/getlist',
  wMatFeedingLog: url + 'reports/wms/machine/feedinglog/getlist',
  //product report
  moMaterial: url + 'wms/stockout/getmatbymo',
  purchase: url + 'wms/purchase/',
  moissue: url + 'wms/moissue/nonissuemo/',
  //print labek code
  labelCode: url + 'masterdata/labelcode/',
  design: url + 'mes/designroute/',
  mrp: url + 'reports/mrp/',
  //lab for CJ
  labDimTestRec: url + 'lab/dimension/testrec/',
  labApply: url + 'lab/labapplication/',
  labLifeTestRec: url + 'lab/lifetest/',

  //新增的api
  label: url + 'masterData/label/',
  dailyplan: url + 'mes/dailyplan/',
  labelconfig: url + 'masterData/labelconfig/',
  barcoderuleusage: url + 'masterData/barcoderuleusage/',
  rackshelf: url + 'wms/rackshelf/',

  //wms
  ordertype: url + 'wms/ordertype/',
  functionconfig: url + 'wms/functionconfig/',
  wInventory: url + 'wms/report/inventory/',
  wInventoryDetail: url + 'wms/report/inventorydetail/',
  sys_wInventoryDetail:url + 'Wms/iqcinspect/inventorydetail/',
  wInventoryLog: url + 'Wms/report/inventory/log/',
  order: url + 'wms/order/',
  common: url + 'wms/common/',
  stocktaking: url + 'Wms/stocktaking/',
  stockin: url + 'Wms/stockin/',
  stockout: url + 'Wms/stockout/',

  //mes pass
  mesPackage: url + 'mes/package/',
  wip: url + 'mes/wip/',
  materialcollect: url + 'mes/materialcollect/',
  scada: url + 'Mes/Scada/GetScadaLogList',

  // fuelCell
  fuelCell: url + 'Mes/fuelcell/',
  // ESOP
  sopItem: url + 'ESop/sopItem/',
  sopManual: url + 'ESop/sopManual/',
  //Workflow
  workflow: url + 'platform/workflow/',

  //orders
  manage: url + 'Mes/order/GetOrderManageList',
  manageId: url + 'Mes/order/GetOrderById',
  manageCreate: url + 'Mes/order/InsertOrUpdateOrderManagement',
  orderNum: url + 'Wms/iqcinspect/GetmoBaseList',

  //onMaterial
  onMaterialSelect: url + 'Mes/mo/getbymostatus',
  onMaterialData: url + 'Mes/order/GetWorkOrderMaterialCompleteSetsList',

  //production
  productionList: url + 'Mes/order/GetGetRealTimeMaterialList',

  //IQC
  inspect: url + 'Wms/iqcinspect/GetIqcInspectionList',
  inspectAdd: url + 'Wms/iqcinspect/InsertOrUpdateIqcInspection',
  inspectId: url + 'Wms/iqcinspect/GetById',
  inspectRemove: url + 'Wms/iqcinspect/DeleteById',

  //warehousing
  wareSubmit: url + 'Wms/iqcinspect/CommitFscclrk',

  //unbound
  unboundSearch: url + 'Wms/iqcinspect/GetSnRelaxList',
  unboundId: url + 'Wms/iqcinspect/SnUnbound',
  unboundSelect: url + 'Wms/iqcinspect/GetmoBaseMaterialList',

  //stockOut
  stockOutOrder: url + 'Wms/iqcinspect/GetmoBaseList',
  stockOutList: url + 'Wms/iqcinspect/GetmoBaseWithWmsList',
  stockOutSubmit: url + 'Wms/iqcinspect/CommitFscclck',

  //mass
  massList: url + 'Mes/qualityassurance/',

  //toolingSearch
  toolingSearch: url + 'Mes/MachineAddress/',
}

export default api
